<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Percentile.EstimationType (Apache Commons Math 3.6.1 API)</title>
<link rel="stylesheet" type="text/css" href="../../../../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
    if (location.href.indexOf('is-external=true') == -1) {
        parent.document.title="Percentile.EstimationType (Apache Commons Math 3.6.1 API)";
    }
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!--   -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/Percentile.EstimationType.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage"><em><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script></em></div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.html" title="class in org.apache.commons.math3.stat.descriptive.rank"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/PSquarePercentile.html" title="class in org.apache.commons.math3.stat.descriptive.rank"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../../index.html?org/apache/commons/math3/stat/descriptive/rank/Percentile.EstimationType.html" target="_top">Frames</a></li>
<li><a href="Percentile.EstimationType.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_top");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#enum_constant_summary">Enum Constants</a>&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#enum_constant_detail">Enum Constants</a>&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!--   -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.apache.commons.math3.stat.descriptive.rank</div>
<h2 title="Enum Percentile.EstimationType" class="title">Enum Percentile.EstimationType</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Enum.html?is-external=true" title="class or interface in java.lang">java.lang.Enum</a>&lt;<a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.EstimationType.html" title="enum in org.apache.commons.math3.stat.descriptive.rank">Percentile.EstimationType</a>&gt;</li>
<li>
<ul class="inheritance">
<li>org.apache.commons.math3.stat.descriptive.rank.Percentile.EstimationType</li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd><a href="http://docs.oracle.com/javase/7/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</a>&lt;<a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.EstimationType.html" title="enum in org.apache.commons.math3.stat.descriptive.rank">Percentile.EstimationType</a>&gt;</dd>
</dl>
<dl>
<dt>Enclosing class:</dt>
<dd><a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.html" title="class in org.apache.commons.math3.stat.descriptive.rank">Percentile</a></dd>
</dl>
<hr>
<br>
<pre>public static enum <span class="strong">Percentile.EstimationType</span>
extends <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Enum.html?is-external=true" title="class or interface in java.lang">Enum</a>&lt;<a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.EstimationType.html" title="enum in org.apache.commons.math3.stat.descriptive.rank">Percentile.EstimationType</a>&gt;</pre>
<div class="block">An enum for various estimation strategies of a percentile referred in
 <a href="http://en.wikipedia.org/wiki/Quantile">wikipedia on quantile</a>
 with the names of enum matching those of types mentioned in
 wikipedia.
 <p>
 Each enum corresponding to the specific type of estimation in wikipedia
 implements  the respective formulae that specializes in the below aspects
 <ul>
 <li>An <b>index method</b> to calculate approximate index of the
 estimate</li>
 <li>An <b>estimate method</b> to estimate a value found at the earlier
 computed index</li>
 <li>A <b> minLimit</b> on the quantile for which first element of sorted
 input is returned as an estimate </li>
 <li>A <b> maxLimit</b> on the quantile for which last element of sorted
 input is returned as an estimate </li>
 </ul>
 <p>
 Users can now create <a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.html" title="class in org.apache.commons.math3.stat.descriptive.rank"><code>Percentile</code></a> by explicitly passing this enum;
 such as by invoking <a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.html#withEstimationType(org.apache.commons.math3.stat.descriptive.rank.Percentile.EstimationType)"><code>Percentile.withEstimationType(EstimationType)</code></a>
 <p>
 References:
 <ol>
 <li>
 <a href="http://en.wikipedia.org/wiki/Quantile">Wikipedia on quantile</a>
 </li>
 <li>
 <a href="https://www.amherst.edu/media/view/129116/.../Sample+Quantiles.pdf">
 Hyndman, R. J. and Fan, Y. (1996) Sample quantiles in statistical
 packages, American Statistician 50, 361–365</a> </li>
 <li>
 <a href="http://stat.ethz.ch/R-manual/R-devel/library/stats/html/quantile.html">
 R-Manual </a></li>
 </ol></div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== ENUM CONSTANT SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="enum_constant_summary">
<!--   -->
</a>
<h3>Enum Constant Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Enum Constant Summary table, listing enum constants, and an explanation">
<caption><span>Enum Constants</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Enum Constant and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.EstimationType.html#LEGACY">LEGACY</a></strong></code>
<div class="block">This is the default type used in the <a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.html" title="class in org.apache.commons.math3.stat.descriptive.rank"><code>Percentile</code></a>.This method
 has the following formulae for index and estimates<br>
 \( \begin{align}
 &amp;index    = (N+1)p\ \\
 &amp;estimate = x_{\lceil h\,-\,1/2 \rceil} \\
 &amp;minLimit = 0 \\
 &amp;maxLimit = 1 \\
 \end{align}\)</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><strong><a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.EstimationType.html#R_1">R_1</a></strong></code>
<div class="block">The method R_1 has the following formulae for index and estimates<br>
 \( \begin{align}
 &amp;index= Np + 1/2\,  \\
 &amp;estimate= x_{\lceil h\,-\,1/2 \rceil} \\
 &amp;minLimit = 0 \\
 \end{align}\)</div>
</td>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.EstimationType.html#R_2">R_2</a></strong></code>
<div class="block">The method R_2 has the following formulae for index and estimates<br>
 \( \begin{align}
 &amp;index= Np + 1/2\, \\
 &amp;estimate=\frac{x_{\lceil h\,-\,1/2 \rceil} +
 x_{\lfloor h\,+\,1/2 \rfloor}}{2} \\
 &amp;minLimit = 0 \\
 &amp;maxLimit = 1 \\
 \end{align}\)</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><strong><a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.EstimationType.html#R_3">R_3</a></strong></code>
<div class="block">The method R_3 has the following formulae for index and estimates<br>
 \( \begin{align}
 &amp;index= Np \\
 &amp;estimate= x_{\lfloor h \rceil}\, \\
 &amp;minLimit = 0.5/N \\
 \end{align}\)</div>
</td>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.EstimationType.html#R_4">R_4</a></strong></code>
<div class="block">The method R_4 has the following formulae for index and estimates<br>
 \( \begin{align}
 &amp;index= Np\, \\
 &amp;estimate= x_{\lfloor h \rfloor} + (h -
 \lfloor h \rfloor) (x_{\lfloor h \rfloor + 1} - x_{\lfloor h
 \rfloor}) \\
 &amp;minLimit = 1/N \\
 &amp;maxLimit = 1 \\
 \end{align}\)</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><strong><a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.EstimationType.html#R_5">R_5</a></strong></code>
<div class="block">The method R_5 has the following formulae for index and estimates<br>
 \( \begin{align}
 &amp;index= Np + 1/2\\
 &amp;estimate= x_{\lfloor h \rfloor} + (h -
 \lfloor h \rfloor) (x_{\lfloor h \rfloor + 1} - x_{\lfloor h
 \rfloor}) \\
 &amp;minLimit = 0.5/N \\
 &amp;maxLimit = (N-0.5)/N
 \end{align}\)</div>
</td>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.EstimationType.html#R_6">R_6</a></strong></code>
<div class="block">The method R_6 has the following formulae for index and estimates<br>
 \( \begin{align}
 &amp;index= (N + 1)p \\
 &amp;estimate= x_{\lfloor h \rfloor} + (h -
 \lfloor h \rfloor) (x_{\lfloor h \rfloor + 1} - x_{\lfloor h
 \rfloor}) \\
 &amp;minLimit = 1/(N+1) \\
 &amp;maxLimit = N/(N+1) \\
 \end{align}\)</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><strong><a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.EstimationType.html#R_7">R_7</a></strong></code>
<div class="block">The method R_7 implements Microsoft Excel style computation has the
 following formulae for index and estimates.<br>
 \( \begin{align}
 &amp;index = (N-1)p + 1 \\
 &amp;estimate = x_{\lfloor h \rfloor} + (h -
 \lfloor h \rfloor) (x_{\lfloor h \rfloor + 1} - x_{\lfloor h
 \rfloor}) \\
 &amp;minLimit = 0 \\
 &amp;maxLimit = 1 \\
 \end{align}\)</div>
</td>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.EstimationType.html#R_8">R_8</a></strong></code>
<div class="block">The method R_8 has the following formulae for index and estimates<br>
 \( \begin{align}
 &amp;index = (N + 1/3)p + 1/3  \\
 &amp;estimate = x_{\lfloor h \rfloor} + (h -
           \lfloor h \rfloor) (x_{\lfloor h \rfloor + 1} - x_{\lfloor h
 \rfloor}) \\
 &amp;minLimit = (2/3)/(N+1/3) \\
 &amp;maxLimit = (N-1/3)/(N+1/3) \\
 \end{align}\)</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><strong><a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.EstimationType.html#R_9">R_9</a></strong></code>
<div class="block">The method R_9 has the following formulae for index and estimates<br>
 \( \begin{align}
 &amp;index = (N + 1/4)p + 3/8\\
 &amp;estimate = x_{\lfloor h \rfloor} + (h -
           \lfloor h \rfloor) (x_{\lfloor h \rfloor + 1} - x_{\lfloor h
 \rfloor}) \\
 &amp;minLimit = (5/8)/(N+1/4) \\
 &amp;maxLimit = (N-3/8)/(N+1/4) \\
 \end{align}\)</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!--   -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected double</code></td>
<td class="colLast"><code><strong><a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.EstimationType.html#estimate(double[],%20int[],%20double,%20int,%20org.apache.commons.math3.util.KthSelector)">estimate</a></strong>(double[]&nbsp;work,
        int[]&nbsp;pivotsHeap,
        double&nbsp;pos,
        int&nbsp;length,
        <a href="../../../../../../../org/apache/commons/math3/util/KthSelector.html" title="class in org.apache.commons.math3.util">KthSelector</a>&nbsp;selector)</code>
<div class="block">Estimation based on K<sup>th</sup> selection.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>double</code></td>
<td class="colLast"><code><strong><a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.EstimationType.html#evaluate(double[],%20double,%20org.apache.commons.math3.util.KthSelector)">evaluate</a></strong>(double[]&nbsp;work,
        double&nbsp;p,
        <a href="../../../../../../../org/apache/commons/math3/util/KthSelector.html" title="class in org.apache.commons.math3.util">KthSelector</a>&nbsp;selector)</code>
<div class="block">Evaluate method to compute the percentile for a given bounded array.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected double</code></td>
<td class="colLast"><code><strong><a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.EstimationType.html#evaluate(double[],%20int[],%20double,%20org.apache.commons.math3.util.KthSelector)">evaluate</a></strong>(double[]&nbsp;work,
        int[]&nbsp;pivotsHeap,
        double&nbsp;p,
        <a href="../../../../../../../org/apache/commons/math3/util/KthSelector.html" title="class in org.apache.commons.math3.util">KthSelector</a>&nbsp;selector)</code>
<div class="block">Evaluate method to compute the percentile for a given bounded array
 using earlier computed pivots heap.<br>
 This basically calls the <a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.EstimationType.html#index(double,%20int)"><code>index</code></a> and then
 <a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.EstimationType.html#estimate(double[],%20int[],%20double,%20int,%20org.apache.commons.math3.util.KthSelector)"><code>estimate</code></a>
 functions to return the estimated percentile value.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected abstract double</code></td>
<td class="colLast"><code><strong><a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.EstimationType.html#index(double,%20int)">index</a></strong>(double&nbsp;p,
     int&nbsp;length)</code>
<div class="block">Finds the index of array that can be used as starting index to
 <a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.EstimationType.html#estimate(double[],%20int[],%20double,%20int,%20org.apache.commons.math3.util.KthSelector)"><code>estimate</code></a>
 percentile.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.EstimationType.html" title="enum in org.apache.commons.math3.stat.descriptive.rank">Percentile.EstimationType</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.EstimationType.html#valueOf(java.lang.String)">valueOf</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;name)</code>
<div class="block">Returns the enum constant of this type with the specified name.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static <a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.EstimationType.html" title="enum in org.apache.commons.math3.stat.descriptive.rank">Percentile.EstimationType</a>[]</code></td>
<td class="colLast"><code><strong><a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.EstimationType.html#values()">values</a></strong>()</code>
<div class="block">Returns an array containing the constants of this enum type, in
the order they are declared.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Enum">
<!--   -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Enum.html?is-external=true" title="class or interface in java.lang">Enum</a></h3>
<code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Enum.html?is-external=true#clone()" title="class or interface in java.lang">clone</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Enum.html?is-external=true#compareTo(E)" title="class or interface in java.lang">compareTo</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Enum.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Enum.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Enum.html?is-external=true#getDeclaringClass()" title="class or interface in java.lang">getDeclaringClass</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Enum.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Enum.html?is-external=true#name()" title="class or interface in java.lang">name</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Enum.html?is-external=true#ordinal()" title="class or interface in java.lang">ordinal</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Enum.html?is-external=true#toString()" title="class or interface in java.lang">toString</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Enum.html?is-external=true#valueOf(java.lang.Class,%20java.lang.String)" title="class or interface in java.lang">valueOf</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!--   -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
<code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait(long,%20int)" title="class or interface in java.lang">wait</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ ENUM CONSTANT DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="enum_constant_detail">
<!--   -->
</a>
<h3>Enum Constant Detail</h3>
<a name="LEGACY">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>LEGACY</h4>
<pre>public static final&nbsp;<a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.EstimationType.html" title="enum in org.apache.commons.math3.stat.descriptive.rank">Percentile.EstimationType</a> LEGACY</pre>
<div class="block">This is the default type used in the <a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.html" title="class in org.apache.commons.math3.stat.descriptive.rank"><code>Percentile</code></a>.This method
 has the following formulae for index and estimates<br>
 \( \begin{align}
 &amp;index    = (N+1)p\ \\
 &amp;estimate = x_{\lceil h\,-\,1/2 \rceil} \\
 &amp;minLimit = 0 \\
 &amp;maxLimit = 1 \\
 \end{align}\)</div>
</li>
</ul>
<a name="R_1">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>R_1</h4>
<pre>public static final&nbsp;<a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.EstimationType.html" title="enum in org.apache.commons.math3.stat.descriptive.rank">Percentile.EstimationType</a> R_1</pre>
<div class="block">The method R_1 has the following formulae for index and estimates<br>
 \( \begin{align}
 &amp;index= Np + 1/2\,  \\
 &amp;estimate= x_{\lceil h\,-\,1/2 \rceil} \\
 &amp;minLimit = 0 \\
 \end{align}\)</div>
</li>
</ul>
<a name="R_2">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>R_2</h4>
<pre>public static final&nbsp;<a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.EstimationType.html" title="enum in org.apache.commons.math3.stat.descriptive.rank">Percentile.EstimationType</a> R_2</pre>
<div class="block">The method R_2 has the following formulae for index and estimates<br>
 \( \begin{align}
 &amp;index= Np + 1/2\, \\
 &amp;estimate=\frac{x_{\lceil h\,-\,1/2 \rceil} +
 x_{\lfloor h\,+\,1/2 \rfloor}}{2} \\
 &amp;minLimit = 0 \\
 &amp;maxLimit = 1 \\
 \end{align}\)</div>
</li>
</ul>
<a name="R_3">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>R_3</h4>
<pre>public static final&nbsp;<a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.EstimationType.html" title="enum in org.apache.commons.math3.stat.descriptive.rank">Percentile.EstimationType</a> R_3</pre>
<div class="block">The method R_3 has the following formulae for index and estimates<br>
 \( \begin{align}
 &amp;index= Np \\
 &amp;estimate= x_{\lfloor h \rceil}\, \\
 &amp;minLimit = 0.5/N \\
 \end{align}\)</div>
</li>
</ul>
<a name="R_4">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>R_4</h4>
<pre>public static final&nbsp;<a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.EstimationType.html" title="enum in org.apache.commons.math3.stat.descriptive.rank">Percentile.EstimationType</a> R_4</pre>
<div class="block">The method R_4 has the following formulae for index and estimates<br>
 \( \begin{align}
 &amp;index= Np\, \\
 &amp;estimate= x_{\lfloor h \rfloor} + (h -
 \lfloor h \rfloor) (x_{\lfloor h \rfloor + 1} - x_{\lfloor h
 \rfloor}) \\
 &amp;minLimit = 1/N \\
 &amp;maxLimit = 1 \\
 \end{align}\)</div>
</li>
</ul>
<a name="R_5">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>R_5</h4>
<pre>public static final&nbsp;<a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.EstimationType.html" title="enum in org.apache.commons.math3.stat.descriptive.rank">Percentile.EstimationType</a> R_5</pre>
<div class="block">The method R_5 has the following formulae for index and estimates<br>
 \( \begin{align}
 &amp;index= Np + 1/2\\
 &amp;estimate= x_{\lfloor h \rfloor} + (h -
 \lfloor h \rfloor) (x_{\lfloor h \rfloor + 1} - x_{\lfloor h
 \rfloor}) \\
 &amp;minLimit = 0.5/N \\
 &amp;maxLimit = (N-0.5)/N
 \end{align}\)</div>
</li>
</ul>
<a name="R_6">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>R_6</h4>
<pre>public static final&nbsp;<a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.EstimationType.html" title="enum in org.apache.commons.math3.stat.descriptive.rank">Percentile.EstimationType</a> R_6</pre>
<div class="block">The method R_6 has the following formulae for index and estimates<br>
 \( \begin{align}
 &amp;index= (N + 1)p \\
 &amp;estimate= x_{\lfloor h \rfloor} + (h -
 \lfloor h \rfloor) (x_{\lfloor h \rfloor + 1} - x_{\lfloor h
 \rfloor}) \\
 &amp;minLimit = 1/(N+1) \\
 &amp;maxLimit = N/(N+1) \\
 \end{align}\)
 <p>
 <b>Note:</b> This method computes the index in a manner very close to
 the default Commons Math Percentile existing implementation. However
 the difference to be noted is in picking up the limits with which
 first element (p&lt;1(N+1)) and last elements (p&gt;N/(N+1))are done.
 While in default case; these are done with p=0 and p=1 respectively.</div>
</li>
</ul>
<a name="R_7">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>R_7</h4>
<pre>public static final&nbsp;<a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.EstimationType.html" title="enum in org.apache.commons.math3.stat.descriptive.rank">Percentile.EstimationType</a> R_7</pre>
<div class="block">The method R_7 implements Microsoft Excel style computation has the
 following formulae for index and estimates.<br>
 \( \begin{align}
 &amp;index = (N-1)p + 1 \\
 &amp;estimate = x_{\lfloor h \rfloor} + (h -
 \lfloor h \rfloor) (x_{\lfloor h \rfloor + 1} - x_{\lfloor h
 \rfloor}) \\
 &amp;minLimit = 0 \\
 &amp;maxLimit = 1 \\
 \end{align}\)</div>
</li>
</ul>
<a name="R_8">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>R_8</h4>
<pre>public static final&nbsp;<a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.EstimationType.html" title="enum in org.apache.commons.math3.stat.descriptive.rank">Percentile.EstimationType</a> R_8</pre>
<div class="block">The method R_8 has the following formulae for index and estimates<br>
 \( \begin{align}
 &amp;index = (N + 1/3)p + 1/3  \\
 &amp;estimate = x_{\lfloor h \rfloor} + (h -
           \lfloor h \rfloor) (x_{\lfloor h \rfloor + 1} - x_{\lfloor h
 \rfloor}) \\
 &amp;minLimit = (2/3)/(N+1/3) \\
 &amp;maxLimit = (N-1/3)/(N+1/3) \\
 \end{align}\)
 <p>
 As per Ref [2,3] this approach is most recommended as it provides
 an approximate median-unbiased estimate regardless of distribution.</div>
</li>
</ul>
<a name="R_9">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>R_9</h4>
<pre>public static final&nbsp;<a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.EstimationType.html" title="enum in org.apache.commons.math3.stat.descriptive.rank">Percentile.EstimationType</a> R_9</pre>
<div class="block">The method R_9 has the following formulae for index and estimates<br>
 \( \begin{align}
 &amp;index = (N + 1/4)p + 3/8\\
 &amp;estimate = x_{\lfloor h \rfloor} + (h -
           \lfloor h \rfloor) (x_{\lfloor h \rfloor + 1} - x_{\lfloor h
 \rfloor}) \\
 &amp;minLimit = (5/8)/(N+1/4) \\
 &amp;maxLimit = (N-3/8)/(N+1/4) \\
 \end{align}\)</div>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!--   -->
</a>
<h3>Method Detail</h3>
<a name="values()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>values</h4>
<pre>public static&nbsp;<a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.EstimationType.html" title="enum in org.apache.commons.math3.stat.descriptive.rank">Percentile.EstimationType</a>[]&nbsp;values()</pre>
<div class="block">Returns an array containing the constants of this enum type, in
the order they are declared.  This method may be used to iterate
over the constants as follows:
<pre>
for (Percentile.EstimationType c : Percentile.EstimationType.values())
&nbsp;   System.out.println(c);
</pre></div>
<dl><dt><span class="strong">Returns:</span></dt><dd>an array containing the constants of this enum type, in the order they are declared</dd></dl>
</li>
</ul>
<a name="valueOf(java.lang.String)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>valueOf</h4>
<pre>public static&nbsp;<a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.EstimationType.html" title="enum in org.apache.commons.math3.stat.descriptive.rank">Percentile.EstimationType</a>&nbsp;valueOf(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;name)</pre>
<div class="block">Returns the enum constant of this type with the specified name.
The string must match <i>exactly</i> an identifier used to declare an
enum constant in this type.  (Extraneous whitespace characters are 
not permitted.)</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>name</code> - the name of the enum constant to be returned.</dd>
<dt><span class="strong">Returns:</span></dt><dd>the enum constant with the specified name</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - if this enum type has no constant with the specified name</dd>
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - if the argument is null</dd></dl>
</li>
</ul>
<a name="index(double, int)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>index</h4>
<pre>protected abstract&nbsp;double&nbsp;index(double&nbsp;p,
           int&nbsp;length)</pre>
<div class="block">Finds the index of array that can be used as starting index to
 <a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.EstimationType.html#estimate(double[],%20int[],%20double,%20int,%20org.apache.commons.math3.util.KthSelector)"><code>estimate</code></a>
 percentile. The calculation of index calculation is specific to each
 <a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.EstimationType.html" title="enum in org.apache.commons.math3.stat.descriptive.rank"><code>Percentile.EstimationType</code></a>.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>p</code> - the p<sup>th</sup> quantile</dd><dd><code>length</code> - the total number of array elements in the work array</dd>
<dt><span class="strong">Returns:</span></dt><dd>a computed real valued index as explained in the wikipedia</dd></dl>
</li>
</ul>
<a name="estimate(double[], int[], double, int, org.apache.commons.math3.util.KthSelector)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>estimate</h4>
<pre>protected&nbsp;double&nbsp;estimate(double[]&nbsp;work,
              int[]&nbsp;pivotsHeap,
              double&nbsp;pos,
              int&nbsp;length,
              <a href="../../../../../../../org/apache/commons/math3/util/KthSelector.html" title="class in org.apache.commons.math3.util">KthSelector</a>&nbsp;selector)</pre>
<div class="block">Estimation based on K<sup>th</sup> selection. This may be overridden
 in specific enums to compute slightly different estimations.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>work</code> - array of numbers to be used for finding the percentile</dd><dd><code>pos</code> - indicated positional index prior computed from calling
            <a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.EstimationType.html#index(double,%20int)"><code>index(double, int)</code></a></dd><dd><code>pivotsHeap</code> - an earlier populated cache if exists; will be used</dd><dd><code>length</code> - size of array considered</dd><dd><code>selector</code> - a <a href="../../../../../../../org/apache/commons/math3/util/KthSelector.html" title="class in org.apache.commons.math3.util"><code>KthSelector</code></a> used for pivoting during search</dd>
<dt><span class="strong">Returns:</span></dt><dd>estimated percentile</dd></dl>
</li>
</ul>
<a name="evaluate(double[], int[], double, org.apache.commons.math3.util.KthSelector)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>evaluate</h4>
<pre>protected&nbsp;double&nbsp;evaluate(double[]&nbsp;work,
              int[]&nbsp;pivotsHeap,
              double&nbsp;p,
              <a href="../../../../../../../org/apache/commons/math3/util/KthSelector.html" title="class in org.apache.commons.math3.util">KthSelector</a>&nbsp;selector)</pre>
<div class="block">Evaluate method to compute the percentile for a given bounded array
 using earlier computed pivots heap.<br>
 This basically calls the <a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.EstimationType.html#index(double,%20int)"><code>index</code></a> and then
 <a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.EstimationType.html#estimate(double[],%20int[],%20double,%20int,%20org.apache.commons.math3.util.KthSelector)"><code>estimate</code></a>
 functions to return the estimated percentile value.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>work</code> - array of numbers to be used for finding the percentile</dd><dd><code>pivotsHeap</code> - a prior cached heap which can speed up estimation</dd><dd><code>p</code> - the p<sup>th</sup> quantile to be computed</dd><dd><code>selector</code> - a <a href="../../../../../../../org/apache/commons/math3/util/KthSelector.html" title="class in org.apache.commons.math3.util"><code>KthSelector</code></a> used for pivoting during search</dd>
<dt><span class="strong">Returns:</span></dt><dd>estimated percentile</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../../../org/apache/commons/math3/exception/OutOfRangeException.html" title="class in org.apache.commons.math3.exception">OutOfRangeException</a></code> - if p is out of range</dd>
<dd><code><a href="../../../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</a></code> - if work array is null</dd></dl>
</li>
</ul>
<a name="evaluate(double[], double, org.apache.commons.math3.util.KthSelector)">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>evaluate</h4>
<pre>public&nbsp;double&nbsp;evaluate(double[]&nbsp;work,
              double&nbsp;p,
              <a href="../../../../../../../org/apache/commons/math3/util/KthSelector.html" title="class in org.apache.commons.math3.util">KthSelector</a>&nbsp;selector)</pre>
<div class="block">Evaluate method to compute the percentile for a given bounded array.
 This basically calls the <a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.EstimationType.html#index(double,%20int)"><code>index</code></a> and then
 <a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.EstimationType.html#estimate(double[],%20int[],%20double,%20int,%20org.apache.commons.math3.util.KthSelector)"><code>estimate</code></a>
 functions to return the estimated percentile value. Please
 note that this method does not make use of cached pivots.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>work</code> - array of numbers to be used for finding the percentile</dd><dd><code>p</code> - the p<sup>th</sup> quantile to be computed</dd><dd><code>selector</code> - a <a href="../../../../../../../org/apache/commons/math3/util/KthSelector.html" title="class in org.apache.commons.math3.util"><code>KthSelector</code></a> used for pivoting during search</dd>
<dt><span class="strong">Returns:</span></dt><dd>estimated percentile</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../../../org/apache/commons/math3/exception/OutOfRangeException.html" title="class in org.apache.commons.math3.exception">OutOfRangeException</a></code> - if length or p is out of range</dd>
<dd><code><a href="../../../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</a></code> - if work array is null</dd></dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!--   -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/Percentile.EstimationType.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage"><em><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script></em></div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.html" title="class in org.apache.commons.math3.stat.descriptive.rank"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/PSquarePercentile.html" title="class in org.apache.commons.math3.stat.descriptive.rank"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../../index.html?org/apache/commons/math3/stat/descriptive/rank/Percentile.EstimationType.html" target="_top">Frames</a></li>
<li><a href="Percentile.EstimationType.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_bottom");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#enum_constant_summary">Enum Constants</a>&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#enum_constant_detail">Enum Constants</a>&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!--   -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright &#169; 2003&#x2013;2016 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</body>
</html>
